package com.huishen.edrivenew.bean;

import org.json.JSONObject;

import com.google.gson.Gson;
import com.huishen.edrivenew.base.BaseBean;
import com.huishen.edrivenew.util.TLog;

public class StudentBean extends BaseBean {
    
    public int id;
    
    public int accountId;
    public int coachId;
    public int schoolId;
    
    public String name;
    public String phone;
    public String path;
    
    public int balance;//剩余金额，
    public int money;//总金额
    public int timeNum;//已学课时

    public int distance;//距离
    
    
    public String toStringObj() {
        Gson gson = new Gson();
        
        
        return gson.toJson(this);
    }
    
    public static StudentBean getFromJson(String json) {
        Gson gson = new Gson();
        StudentBean bean = gson.fromJson(json, StudentBean.class);
        return bean;
    }
    
    
    
    public boolean getIsSchool() {
//        this.coachId == 0 则是约学校
        TLog.log("coachId :" + coachId);
        return this.coachId == 0;
    }
    
    
    
    public static BaseBean parseJson(JSONObject jsonObj) {
        Gson gson = new Gson();
        
        StudentBean bean = gson.fromJson(jsonObj.toString(), StudentBean.class);
        
        return bean;
    }
    
    
}
